using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Hiranipra.SceneModel;
using Hiranipra.Scenes.Island;

namespace Hiranipra.SceneModel
{
	public class SceneComponent : DrawableGameComponent
	{
		private GraphicsDeviceManager _graphicsManager;
		private ContentManager _contentManager;

		public readonly ISceneFactory Factory;
		public readonly Scene Scene;

		public SceneComponent( GameClient game )
			: base( game )
		{
			_graphicsManager = game.GraphicsManager;
			_contentManager = new ContentManager( game.Services );
			this.Factory = new IslandFactory();
			this.Scene = new Scene();
		}

		public override void Update( GameTime gameTime )
		{
		}

		protected override void LoadContent()
		{
			for( int n = 0; n < this.Factory.LoadingSetCount; n++ )
				this.Factory.Load( n );
		}

		protected override void UnloadContent()
		{
			this.Factory.Unload();
		}
	}
}
